import request from '@/utils/request';

export type Result_DATA = {
  data: Record<string, any>;
  info: string;
  msg: string;
  result: number;
  seq: string;
};


export type LoginByPassword = {
    userName: string;
    password: string;
};
export const loginByPassword = async (
    params: LoginByPassword,
    options?: { [key: string]: any },
) => {
    return request<Result_DATA>('/gpt/gateway/login/by/passwd', {
        method: 'POST',
        data: {
            ...params,
        },
        ...(options || {}),
    });
};
type CurrentUser = {
  userId: string;
}
export const currentUser = async (
    params: CurrentUser,
    options?: { [key: string]: any },
) => {
    return request<Result_DATA>('/gpt/gateway/get/user/info', {
        method: 'POST',
        data: {
            ...params,
        },
        ...(options || {}),
    });
}
